<template>
  <el-dialog title="统计内容" :visible.sync="open" width="35%" :before-close="closeDelDialog">
    <div v-if="radio=='4'">
      <el-checkbox-group v-model="select">
        <el-checkbox label="FWCS#访问次数">访问次数</el-checkbox>
      </el-checkbox-group>
    </div>
    <div v-else>
      <el-checkbox-group v-model="select">
        <el-checkbox label="JIANSHU#件数">件数</el-checkbox>
        <el-checkbox label="JUANSHU#卷数">卷数</el-checkbox>
        <el-checkbox label="JIANYS#件页数">件页数</el-checkbox>
        <el-checkbox label="YESHU#页数">页数</el-checkbox>
        <el-checkbox label="JYRC#借阅人数">借阅人数</el-checkbox>
      </el-checkbox-group>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="submit">提 交</el-button>
      <el-button @click="closeDelDialog">取 消</el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: "statisticsSelection",
  props: ["open", "radio"],
  data() {
    return {
      select: []
    }
  },
  methods: {
    init(val) {
      this.select = val.split(',')
    },
    // 提交
    submit() {
      if(this.select.length == 0) {
        this.$message({ message: '请选择至少一个统计内容!', type: 'warning' })
        return;
      }
      var data = this.select.toString()
      this.$emit("getNeiRong", data)
      this.select = []
    },
    //关闭页面
    closeDelDialog() {
      this.$emit("cancel")
      this.select = []
    },
  }
}
</script>

<style scoped>

</style>
